/**************************************************************************************************
|
| MediaMAX - Media Sharing Script
| http://www.isoftscripts.com
| sales@isoftscripts.com
| Version: 1.3.3
|
|**************************************************************************************************
|
| By using this software you agree that you have read and acknowledged our End-User License 
| Agreement available at http://www.isoftscripts.com/mediamax-eula.html and to be bound by it.
|
| Copyright (c) 2008 iSoftScripts.com. All rights reserved.
|**************************************************************************************************/

Upgrade Instructions - v1.3.2 to v1.3.3


1. css/style1.css
Find:
background:transparent url(../images/section_header_bg_grey.jpg) repeat-x top center

Delete It



2. Run the database update file dbupdate.sql in your database management tool such as phpmyadmin.



3. Open themes/playvideo.tpl
Find:
<form name="addcommentform" method="POST" action="#">

Add Above:
<script type="text/javascript" src="{$baseurl}/js/charcount.js"></script>

Find:
<textarea name="addcomment" id="addcomment" rows="5" cols="90">

Replace With:
<textarea name="addcomment" id="addcomment" rows="5" cols="90" onblur="textrem(this,this.form.rem, '{$max_com_video}');" onkeyup="textrem(this,this.form.rem, '{$max_com_video}');" onkeydown="textrem(this,this.form.rem, '{$max_com_video}');" >

Find:
</form>

Add Above:
<br /><input type="text" name="rem" style="width:30px" maxlength="4" size="4" value="{$max_com_video}" onblur="textrem(this.form.addcomment, this, '{$max_com_video}');" readonly />&nbsp;{$lang787}



4. Open themes/viewpicture.tpl
Find:
<form name="addcommentform" method="POST" action="#">

Add Above:
<script type="text/javascript" src="{$baseurl}/js/charcount.js"></script>

Find:
<textarea name="addcomment" id="addcomment" rows="5" cols="90">

Replace With:
<textarea name="addcomment" id="addcomment" rows="5" cols="90" onblur="textrem(this,this.form.rem, '{$max_com_picture}');" onkeyup="textrem(this,this.form.rem, '{$max_com_picture}');" onkeydown="textrem(this,this.form.rem, '{$max_com_picture}');" >

Find:
</form>

Add Above:
<br /><input type="text" name="rem" style="width:30px" maxlength="4" size="4" value="{$max_com_picture}" onblur="textrem(this.form.addcomment, this, '{$max_com_picture}');" readonly />&nbsp;{$lang787}



5. themes/playaudio.tpl
Find:
<form name="addcommentform" method="POST" action="#">

Add Above:
<script type="text/javascript" src="{$baseurl}/js/charcount.js"></script>

Find:
<textarea name="addcomment" id="addcomment" rows="5" cols="90">

Replace With:
<textarea name="addcomment" id="addcomment" rows="5" cols="90" onblur="textrem(this,this.form.rem, '{$max_com_audio}');" onkeyup="textrem(this,this.form.rem, '{$max_com_audio}');" onkeydown="textrem(this,this.form.rem, '{$max_com_audio}');" >

Find:
</form>

Add Above:
<br /><input type="text" name="rem" style="width:30px" maxlength="4" size="4" value="{$max_com_audio}" onblur="textrem(this.form.addcomment, this, '{$max_com_audio}');" readonly />&nbsp;{$lang787}



6. themes/memberprofile.tpl
Find:
<form name="sendmessageform" method="POST" action="#">

Add Above:
<script type="text/javascript" src="{$baseurl}/js/charcount.js"></script>

Find:
<textarea name="sendmessagetext" id="sendmessagetext" rows="3" cols="60">

Replace With:
<textarea name="sendmessagetext" id="sendmessagetext" rows="3" cols="60" onblur="textrem(this,this.form.rem, '{$max_com_msg}');" onkeyup="textrem(this,this.form.rem, '{$max_com_msg}');" onkeydown="textrem(this,this.form.rem, '{$max_com_msg}');" >

Find:
</form>

Add Above:
<br /><input type="text" name="rem" style="width:30px" maxlength="4" size="4" value="{$max_com_msg}" onblur="textrem(this.form.addcomment, this, '{$max_com_msg}');" readonly />&nbsp;{$lang787}

Find:
<textarea name="addcomment" id="addcomment" rows="5" cols="90">

Replace With:
<textarea name="addcomment" id="addcomment" rows="5" cols="90" onblur="textrem(this,this.form.rem, '{$max_com_profile}');" onkeyup="textrem(this,this.form.rem, '{$max_com_profile}');" onkeydown="textrem(this,this.form.rem, '{$max_com_profile}');" >

Find:
</form>

Add Above:
<br /><input type="text" name="rem" style="width:30px" maxlength="4" size="4" value="{$max_com_profile}" onblur="textrem(this.form.addcomment, this, '{$max_com_profile}');" readonly />&nbsp;{$lang787}



7. themes/channeldetails.tpl
Find:
<form name="addcommentform" method="POST" action="#">

Add Above:
<script type="text/javascript" src="{$baseurl}/js/charcount.js"></script>

Find:
<textarea name="addcomment" id="addcomment" rows="5" cols="90">

Replace With:
<textarea name="addcomment" id="addcomment" rows="5" cols="90" onblur="textrem(this,this.form.rem, '{$max_com_channel}');" onkeyup="textrem(this,this.form.rem, '{$max_com_channel}');" onkeydown="textrem(this,this.form.rem, '{$max_com_channel}');" >

Find:
</form>

Add Above:
<br /><input type="text" name="rem" style="width:30px" maxlength="4" size="4" value="{$max_com_channel}" onblur="textrem(this.form.addcomment, this, '{$max_com_channel}');" readonly />&nbsp;{$lang787}



8. Open themes/viewmessage.tpl
Find:
<form name="sendmessageform" method="POST" action="#">

Add Above:
<script type="text/javascript" src="{$baseurl}/js/charcount.js"></script>

Find:
<textarea name="sendmessagetext" id="sendmessagetext" rows="3" cols="60">

Replace With:
<textarea name="sendmessagetext" id="sendmessagetext" rows="3" cols="60" onblur="textrem(this,this.form.rem, '{$max_com_msg}');" onkeyup="textrem(this,this.form.rem, '{$max_com_msg}');" onkeydown="textrem(this,this.form.rem, '{$max_com_msg}');" >

Find:
</form>

Add Above:
<br /><input type="text" name="rem" style="width:30px" maxlength="4" size="4" value="{$max_com_msg}" onblur="textrem(this.form.addcomment, this, '{$max_com_msg}');" readonly />&nbsp;{$lang787}



9. Open include/lang/english.php
Find:
$lang['787'] =  "";

Replace With:
$lang['787'] =  "Characters Left";

Find:
$lang['159'] =  "What\'s your username";

Replace With:
$lang['159'] =  "What's your username";



10. Open include/lang/spanish.php
Find:
$lang['787'] =  "";

Replace With:
$lang['787'] =  "Caracteres Izquierda";



11. Open themes/administrator/settings.tpl
Find:
	<tr>
            <td colspan="2" align='center'>
            <input type='submit' name='submit' value='Update'>
            </td>
    </tr>
	

Add Above:
	<tr>
            <td width="40%"><b>Require newly uploaded videos to be validated?</b></td>
            <td>
            <input type="radio" value="1" name="approve_videos" id="approve_videos" {if $approve_videos eq "1"}checked{/if}>Yes&nbsp;&nbsp;&nbsp;
            <input type="radio" value="0" name="approve_videos" id="approve_videos" {if $approve_videos eq "0"}checked{/if}>No
            </td>
    </tr>
	
	<tr>
            <td width="40%"><b>Maximum Video Comment Characters</b></td>
            <td>
            <input name='max_com_video' value='{$max_com_video}' size="40">
            </td>
    </tr>
	
	<tr>
            <td width="40%"><b>Maximum Picture Comment Characters</b></td>
            <td>
            <input name='max_com_picture' value='{$max_com_picture}' size="40">
            </td>
    </tr>
	
	<tr>
            <td width="40%"><b>Maximum Audio Comment Characters</b></td>
            <td>
            <input name='max_com_audio' value='{$max_com_audio}' size="40">
            </td>
    </tr>
	
	<tr>
            <td width="40%"><b>Maximum Profile Comment Characters</b></td>
            <td>
            <input name='max_com_profile' value='{$max_com_profile}' size="40">
            </td>
    </tr>
	
	<tr>
            <td width="40%"><b>Maximum Channel Comment Characters</b></td>
            <td>
            <input name='max_com_channel' value='{$max_com_channel}' size="40">
            </td>
    </tr>
	
	<tr>
            <td width="40%"><b>Maximum Message Comment Characters</b></td>
            <td>
            <input name='max_com_msg' value='{$max_com_msg}' size="40">
            </td>
    </tr>
	
	<tr>
            <td width="40%"><b>Enable Image Captcha</b></td>
            <td>
            <input type="radio" value="1" name="enable_captcha" id="enable_captcha" {if $enable_captcha eq "1"}checked{/if}>Yes&nbsp;&nbsp;&nbsp;
            <input type="radio" value="0" name="enable_captcha" id="enable_captcha" {if $enable_captcha eq "0"}checked{/if}>No
            </td>
    </tr>
    
    <tr>
            <td width="40%"><b>Only allow verified e-mails to upload?</b></td>
            <td>
            <input type="radio" value="1" name="verify_upload" id="verify_upload" {if $verify_upload eq "1"}checked{/if}>Yes&nbsp;&nbsp;&nbsp;
            <input type="radio" value="0" name="verify_upload" id="verify_upload" {if $verify_upload eq "0"}checked{/if}>No
            </td>
    </tr>
		
	
	
12. Open themes/administrator/navigation.tpl
Find:
<div class="navitem1"><a href="listvideos.php" class="navlink" target="body">List Videos</a></div>

Add Above:
<div class="navitem2"><a href="validatevideos.php" class="navlink" target="body">Validate Videos</a></div>



13. Open administrator/settings.php

Find:
	$sql = "update config set value='".mysql_real_escape_string($_REQUEST[max_viewing_now])."' where setting='max_viewing_now'";
		$conn->execute($sql);
		
Add Below:
	$sql = "update config set value='".mysql_real_escape_string($_REQUEST[approve_videos])."' where setting='approve_videos'";
		$conn->execute($sql);
	$sql = "update config set value='".mysql_real_escape_string($_REQUEST[max_com_video])."' where setting='max_com_video'";
		$conn->execute($sql);
	$sql = "update config set value='".mysql_real_escape_string($_REQUEST[max_com_picture])."' where setting='max_com_picture'";
		$conn->execute($sql);
	$sql = "update config set value='".mysql_real_escape_string($_REQUEST[max_com_audio])."' where setting='max_com_audio'";
		$conn->execute($sql);
	$sql = "update config set value='".mysql_real_escape_string($_REQUEST[max_com_profile])."' where setting='max_com_profile'";
		$conn->execute($sql);
	$sql = "update config set value='".mysql_real_escape_string($_REQUEST[max_com_channel])."' where setting='max_com_channel'";
		$conn->execute($sql);
	$sql = "update config set value='".mysql_real_escape_string($_REQUEST[max_com_msg])."' where setting='max_com_msg'";
		$conn->execute($sql);
	$sql = "update config set value='".mysql_real_escape_string($_REQUEST[enable_captcha])."' where setting='enable_captcha'";
		$conn->execute($sql);
	$sql = "update config set value='".mysql_real_escape_string($_REQUEST[verify_upload])."' where setting='verify_upload'";
		$conn->execute($sql);
		
		

14. Open themes/login.tpl
Find:
					<tr>
			            <td align="right" width="160">&nbsp;</td>
			            <td align="left">
		                    	<img src="{$baseurl}/include/captcha.php" /><br/> 	
						</td>
			        </tr>
                    <tr>
			            <td align="right" width="160">{$lang249}&nbsp;</td>
			            <td align="left">
		                    	<input name="imagecode" type="text" value="" class="textField"/><br/> 	
						</td>
			        </tr>
					
					
Replace With:
					{if $enable_captcha ne "0"}
                    <tr>
			            <td align="right" width="160">&nbsp;</td>
			            <td align="left">
		                    	<img src="{$baseurl}/include/captcha.php" /><br/> 	
						</td>
			        </tr>
                    <tr>
			            <td align="right" width="160">{$lang249}&nbsp;</td>
			            <td align="left">
		                    	<input name="imagecode" type="text" value="" class="textField"/><br/> 	
						</td>
			        </tr>
                    {/if}
					
					
					
15. Open login.php
Find:
		$error="$lang[576]";

Replace With:
		if ($config['enable_captcha'] != "0")
		{
			$error="$lang[576]";
		}
		
		
Find:
	else
	{
		$md5pass = md5($password);
		
Replace With:
	if ($error == "")
	{
		$md5pass = md5($password);
		


16. Open uploadaudio.php
Find:
	if ($_SESSION[VERIFIED] != "1")
	{
		$error = "$lang[835]";
	}


Replace With:
	if ($config['verify_upload'] != "0")
	{
		if ($_SESSION[VERIFIED] != "1")
		{
			$error = "$lang[835]";
		}
	}
	
	

17. Open uploadpicture.php
Find:
	if ($_SESSION[VERIFIED] != "1")
	{
		$error = "$lang[735]";
	}


Replace With:
	if ($config['verify_upload'] != "0")
	{
		if ($_SESSION[VERIFIED] != "1")
		{
			$error = "$lang[735]";
		}
	}
	
	
	
18. Open uploadvideo.php
Find:
	if ($_SESSION[VERIFIED] != "1")
	{
		$error = "$lang[685]";
	}


Replace With:
	if ($config['verify_upload'] != "0")
	{
		if ($_SESSION[VERIFIED] != "1")
		{
			$error = "$lang[685]";
		}
	}



19. Open login.php
Find:
if($_REQUEST[register]!="")

Add Above:
$redirect = base64_decode($_REQUEST['redirect']);
$redirect = escape($redirect);

if ($_SESSION[USERID] != "" && $redirect != "")
{
	header("Location:$redirect");exit;
}


Find:
			header("Location:$config[baseurl]");exit;

Replace With:
			if($redirect == "")
			{
				header("Location:$config[baseurl]");exit;
			}
			else
			{
				header("Location:$redirect");exit;
			}
			

Find:
			if($_REQUEST['go']!="")
			{
				$goto = stripslashes($_REQUEST[go]);
				$gotopage=$goto.".php";
			}
			else
			{
				$gotopage="index.php";
			}

			header("Location:$config[baseurl]/$gotopage");exit;
			
Replace With:
			if($redirect == "")
			{
				header("Location:$config[baseurl]");exit;
			}
			else
			{
				header("Location:$redirect");exit;
			}



20. Open themes/login.tpl
Find both instances of:
</form>

Add Above:
<input type="hidden" name="redirect" value="{$smarty.request.redirect}" />



21. Open themes/playvideoverifymature.tpl
Find both instances of:
{$baseurl}/login.php

Replace With:
{insert name=get_evideourl value=a assign=eurl videoid=$videoarray[0].VIDEOID}{$eurl}



22. Open include/functions/main.php
Find:
?>

Add Above:
function insert_get_evideourl($a)
{
    global $config,$conn;
    $query="select title from videos where VIDEOID='".mysql_real_escape_string($a[videoid])."'";
    $executequery=$conn->execute($query);
    $turl = $config['baseurl']."/videos/".$a[videoid]."/".$executequery->fields[title];
	return $config['baseurl']."/login.php?redirect=".base64_encode($turl);
}

function insert_get_epictureurl($a)
{
    global $config,$conn;
    $query="select title from pictures where PICTUREID='".mysql_real_escape_string($a[pictureid])."'";
    $executequery=$conn->execute($query);
    $turl = $config['baseurl']."/pictures/".$a[pictureid]."/".$executequery->fields[title];
	return $config['baseurl']."/login.php?redirect=".base64_encode($turl);
}

function insert_get_eaudiourl($a)
{
    global $config,$conn;
    $query="select title from audios where AUDIOID='".mysql_real_escape_string($a[audioid])."'";
    $executequery=$conn->execute($query);
    $turl = $config['baseurl']."/audios/".$a[audioid]."/".$executequery->fields[title];
	return $config['baseurl']."/login.php?redirect=".base64_encode($turl);
}



23. Open themes/playaudioverifymature.tpl
Find both instances of:
{$baseurl}/login.php

Replace With:
{insert name=get_eaudiourl value=a assign=eurl audioid=$audioarray[0].AUDIOID}{$eurl}



24. Open themes/viewpictureverifymature.tpl
Find both instances of:
{$baseurl}/login.php

Replace With:
{insert name=get_epictureurl value=a assign=eurl pictureid=$picturearray[0].PICTUREID}{$eurl}



25. Open familyfilter.php
Find:
$message = "$lang[557] <a href=\"$thebaseurl/familyfilter.php\">$lang[558]</a>";

Add Below:
			$query="SELECT familyfilter FROM members WHERE USERID='".mysql_real_escape_string($_SESSION[USERID])."'";
        	$executequery=$conn->execute($query);
        	$newfamilyfilter = $executequery->fields[familyfilter];
			if ($newfamilyfilter == "0" || $newfamilyfilter == "1")
			{
				$_SESSION[FAMILYFILTER]  = $newfamilyfilter;
			}



26. Open themes/featuredaudios.tpl
Find:
{$featuredaudios[i].description}

Replace With:
{insert name=get_stripped_phrase value=a assign=fadesc details=$featuredaudios[i].description}{$fadesc}



27. Open themes/featuredpictures.tpl
Find:
{$featuredpictures[i].description}

Replace With:
{insert name=get_stripped_phrase value=a assign=fpdesc details=$featuredpictures[i].description}{$fpdesc}



28. Open themes/featuredvideos.tpl
Find:
{$featuredvideos[i].description}

Replace With:
{insert name=get_stripped_phrase value=a assign=fdesc details=$featuredvideos[i].description}{$fdesc}



29. Open css/style2.php
Find:
_height:600px;

Delete It


30. Upload all files provided in the update_files folder to your website in the current directory structure.



31. Open version.txt
Change it's contents to v1.3.3 to keep track of the version you are running.
